﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ascx_head : System.Web.UI.UserControl
{
    public bool ShowNav = true;
    public int Index = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        InitHead();
        //不显示导航条
        if (!ShowNav) divNav.Visible = false;
    }

    public void InitHead()
    {
        string url = Request.RawUrl.ToLower();
        if (url.IndexOf("/data/") > -1)
        {
            Index = 2;
        }
        else if (url.IndexOf("/signature/") > -1)
        {
            Index = 3;
        }
        else if (url.IndexOf("/nick/") > -1)
        {
            Index = 4;
        }
        else if (url.IndexOf("/pic/") > -1)
        {
            Index = 5;
        }
        else if (url.IndexOf("/headimg/") > -1)
        {
            Index = 6;
        }
        else if (url.IndexOf("/face/") > -1)
        {
            Index = 7;
        }
        else if (url.IndexOf("/impression/") > -1)
        {
            Index = 8;
        }
        else if (url.IndexOf("/group/") > -1)
        {
            Index = 9;
        }
        else if (url.IndexOf("/music/") > -1)
        {
            Index = 10;
        }
        else if (url.IndexOf("/code/") > -1)
        {
            Index = 11;
        }
        else if (url.IndexOf("/default") > -1)
        {
            Index = 1;
        }
        else
            Index = 0;
    }

    public string GetCurr(int i)
    {
        if (i == Index) return " class=\"a5\" ";
        else return "";
    }
}